﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FlatRedBall;
using FlatRedBall.Math.Geometry;

namespace Runaway
{
    public class Platform : PositionedObject
    {
        private Sprite sprite;
        private AxisAlignedRectangle hitBox;

        public Platform(float x, float y)
        {
            SpriteManager.AddPositionedObject(this);

            this.X = x;
            this.Y = y;

            sprite = SpriteManager.AddSprite("Content/Prototype/tileground1.png");
            sprite.AttachTo(this, false);
            sprite.PixelScale();

            hitBox = ShapeManager.AddAxisAlignedRectangle();
            hitBox.AttachTo(this, false);
            hitBox.ScaleY = sprite.ScaleY;
            hitBox.ScaleX = sprite.ScaleX;
        }

        public AxisAlignedRectangle getHitBox()
        {
            return (hitBox);
        }

        public void Destroy()
        {
            SpriteManager.RemoveSprite(sprite);
            ShapeManager.Remove(hitBox);
        }


    }
}
